﻿/*-------------------------------------------------------------------------
* CLR版本:     4.0.30319.42000
* 创建人:      song 
* 创建时间：   2024/7/11 17:40:56
* 功 能：      渲染逻辑抛出到Render层
*-------------------------------------------------------------------------*/

using BattleCore.render;
using System.Collections.Generic;

namespace BattleCore.logic
{
    public class engine_render
    {
        public irender_system _renderSystem;
        private Queue<render_msg> _renderQueue = new Queue<render_msg>();//渲染队列

        public void SendMessage(render_msg msg)
        {
            _renderQueue.Enqueue(msg);
        }

        public void Update(float t , float dt)
        {
            while (_renderQueue.Count > 0)
            {
                var msg = _renderQueue.Dequeue();
                _renderSystem?.PushMsg(msg, t, dt);
            }
            _renderSystem?.Update(t, dt);
        }

        public void LateUpdate(float t, float dt)
        {
             _renderSystem?.LateUpdate(t, dt);
        }

    }
}